package com.xucy.springboot.common.MustPrettyTree;


import lombok.Getter;
import lombok.Setter;

/**
 * @Author xucy
 * @Date 2019-04-17 15:41
 * @Description 最优二叉树（赫夫曼树）的节点
 **/
@Getter
@Setter
public class Node implements Comparable<Node>{
    int value;
    Node leftNode;
    Node rightNode;

    public Node(int value){
        this.value=value;
    }


    @Override
    public int compareTo(Node o) {
        return -(this.value-o.value);
    }

    @Override
    public String toString() {
        return "Node{" +
                "value=" + value +
                '}';
    }
}
